/*
 * Author: Drew Callan & Madalyn Spivey
 * Date: 2/9/2012
 * Abstract: Simulates Craps Game 
 *
 *
 # Project members authenticate over HTTPS to allow committing changes.
svn checkout https://madalyn-drew-craps.googlecode.com/svn/trunk/ madalyn-drew-craps --username dcallan@csumb.edu
 *
 *
 */


import java.util.Random;

public class Lab43802 
{
	private static final Random nextRand = new Random();
	
	public static void main(String[] args)
	{
		
		int diceRollVal = rollDice();
		int points = 10;
		
		while(points > 0)
		{
			System.out.println("You Rolled: " + diceRollVal);
			

			if(diceRollVal == 2) 
			{
				points = 0;
				System.out.println("Craps. You Lose!!!");
			}
			else if(diceRollVal == 3)
			{	
				points = 0;
				System.out.println("Craps. You Lose!!!");
			}
			else if(diceRollVal == 7) 
			{	
				points = 0;
				System.out.println("You Win!!!");
			}
			else if(diceRollVal == 11)
			{	
				points = 0;
				System.out.println("You Win!!!");
			}
			else if(diceRollVal == 12)
			{	
				points = 0;
				System.out.println("Craps. You Lose!!!");
			}
			else
			{	
				points--;
				System.out.println("Roll Again. You Have " + points + " Points Left.");
				if(points == 0)
					System.out.println("You ran out of points. You Lose!!!");
				diceRollVal = rollDice();
			}
		}

	}
	public static int rollDice()
	{
		int dice1 = 1 + nextRand.nextInt(6);
		int dice2 = 1 + nextRand.nextInt(6);
		
		return (dice1 + dice2);
	}

}
